$(document).ready(function() {
	/* //背景粒子效果
	 $('.main-container').particleground({
	     dotColor : '#5cbdaa',
	     lineColor : '#5cbdaa'
	 });
	 $('.main-content').css({
	     'margin-top' : -($('.main-content').height())
	 });*/

	//注册回车键事件
	document.onkeypress = function(e) {
		var ev = document.all ? window.event : e;
		if (ev.keyCode == 13) {
			login();
		}
	};

});

//页面进行跳转到login.html
/*if (window.location.href.indexOf("/login.html") == -1) {
    top.location.href = "login.jsp1";
}*/

//登录
function login() {
	if ($("#accountName").val() == "") {
		layer.alert('请输入用户名' , {icon: 5 , shift: 6 , time: 0
		});
		$("#accountName").focus();
		return false;
	} else {
		/*var reg =
		        /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
		if (!reg.test($("#accountName").val())) {
			layer.alert('请输入正确的邮箱' , {icon: 5 , shift: 6 , time: 0
			});
			$("#accountName").focus();
			return false;
		}*/
	}
	if ($("#password").val() == "") {
		layer.alert('请输入密码' , {icon: 5 , shift: 6 , time: 0
		});
		$("#password").focus();
		return false;
	}
	if ($("#captcha").val() == "") {
		$("#captcha").focus();
		layer.alert('请输入验证码' , {icon: 5 , shift: 6 , time: 0
		});
		return false;
	}
	$("#loginform").submit();
}
